import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:mandoby/core/app_export.dart';
import 'package:mandoby/core/utils/app_colors.dart';
import 'package:nb_utils/nb_utils.dart';

import 'custom_dialog.dart';

class DropDownWidget extends StatefulWidget {
  const DropDownWidget({super.key});

  @override
  // ignore: library_private_types_in_public_api
  _DropDownWidgetState createState() => _DropDownWidgetState();
}

class _DropDownWidgetState extends State<DropDownWidget> {
  @override
  Widget build(BuildContext context) {
    return Container(
      height: 80.h,
      padding: EdgeInsets.all(10.h),
      decoration: BoxDecoration(
          color: AppColors.primary, borderRadius: BorderRadius.circular(15.h)),
      child: Center(
        child: DropdownButton(
          icon: const Icon(Icons.arrow_drop_down, color: Colors.white),
          underline: const SizedBox(),
          hint: Text(
            "اختر الكلية",
            style: CustomTextStyles.font18White800
                .copyWith(fontWeight: FontWeight.w400),
          ),
          items: <String>[
            'طب ',
            'هندسة ',
            'تجارة ',
            'حقوق ',
          ].map<DropdownMenuItem<String>>((String value) {
            return DropdownMenuItem<String>(
              value: value,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceAround,
                children: [
                  Text(value,
                      style: CustomTextStyles.font24bBlack400
                          .copyWith(color: AppColors.black900, fontSize: 26.h)),
                  200.ws,
                ],
              ),
            );
          }).toList(),
          onChanged: (String? value) {
            Future.delayed(150.ms).then((value) {

              showDialog(
                  context: context,
                  builder: (context) => const CustomDialog());
            });
          },
        ),
      ),
    );
  }
}
